package com.everest.tribalapp;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class Desa_Form4 extends Activity implements OnClickListener
{

	private Button next;
	private Button prev;
	private EditText desa_f4_ans_1; 
	private CheckBox desa_f4_ans_2a;
	private CheckBox desa_f4_ans_2b;
	private CheckBox desa_f4_ans_2c;
	private CheckBox desa_f4_ans_2d;
	private CheckBox desa_f4_ans_2e;
	private CheckBox desa_f4_ans_2f;
	private CheckBox desa_f4_ans_2g;
	private EditText desa_f4_ans_2h;
	private EditText desa_f4_ans_3;
	private EditText desa_f4_ans_4;
	private EditText desa_f4_ans_5;
	private EditText desa_f4_ans_6;
	private EditText desa_f4_ans_7;
	private EditText desa_f4_ans_8;
	private EditText desa_f4_ans_9;
	private EditText desa_f4_ans_10;
	private EditText desa_f4_ans_11a;
	private EditText desa_f4_ans_11ba;
	private EditText desa_f4_ans_11bb;
	private EditText desa_f4_ans_11bc;
	private EditText desa_f4_ans_11bd;
	private EditText desa_f4_ans_11c;
	private EditText desa_f4_ans_12;
	private EditText desa_f4_ans_13a;
	private EditText desa_f4_ans_13b;
	private EditText desa_f4_ans_13c; 
	private EditText desa_f4_ans_14a;
	private EditText desa_f4_ans_14b;
	private EditText desa_f4_ans_14c;
	private EditText desa_f4_ans_14d;
	private EditText desa_f4_ans_15;
	private EditText desa_f4_ans_16a;
	private EditText desa_f4_ans_16b;
	private EditText desa_f4_ans_17;
	private EditText desa_f4_ans_18;
	private EditText desa_f4_ans_19;
	private EditText desa_f4_ans_20;
	private EditText desa_f4_ans_21a;
	private EditText desa_f4_ans_21b;
	private CheckBox desa_f4_ans_22a;
	private CheckBox desa_f4_ans_22b;
	private CheckBox desa_f4_ans_22c;
	private CheckBox desa_f4_ans_22d;
	private EditText desa_f4_ans_22e;
	
	private TextView desa_f4_qes_1; 
	private TextView desa_f4_qes_2; 
	private TextView desa_f4_qes_2h;
	private TextView desa_f4_qes_3;
	private TextView desa_f4_qes_4;
	private TextView desa_f4_qes_5;
	private TextView desa_f4_qes_6;
	private TextView desa_f4_qes_7;
	private TextView desa_f4_qes_8;
	private TextView desa_f4_qes_9;
	private TextView desa_f4_qes_10;
	private TextView desa_f4_qes_11a;
	private TextView desa_f4_qes_11ba;
	private TextView desa_f4_qes_11bb;
	private TextView desa_f4_qes_11bc;
	private TextView desa_f4_qes_11bd;
	private TextView desa_f4_qes_11c;
	private TextView desa_f4_qes_12;
	private TextView desa_f4_qes_13a;
	private TextView desa_f4_qes_13b;
	private TextView desa_f4_qes_13c; 
	private TextView desa_f4_qes_14a;
	private TextView desa_f4_qes_14b;
	private TextView desa_f4_qes_14c;
	private TextView desa_f4_qes_14d;
	private TextView desa_f4_qes_15;
	private TextView desa_f4_qes_16a;
	private TextView desa_f4_qes_16b;
	private TextView desa_f4_qes_17;
	private TextView desa_f4_qes_18;
	private TextView desa_f4_qes_19;
	private TextView desa_f4_qes_20;
	private TextView desa_f4_qes_21a;
	private TextView desa_f4_qes_21b; 
	private TextView desa_f4_qes_22;  
	private TextView desa_f4_qes_22e;
	
	private CharSequence[] MSG_VALUES_1={"Ya -> Lanjut ke No IV.4","Tidak"};
	private CharSequence[] MSG_VALUES_2={"Perangkat tidak di gunakan","Tidak  terkoneksi (OFFLINE) ","Perangkat rusak ", "Pengelola tidak memiliki SDM yang mempunyai keahlian komputer memadai", "Sumber energi listrik mahal dan terbatas (biaya pembelian BBM tinggi)", "Kalah bersaing dengan warnet lain ", "Lainnya, "};
	private CharSequence[] MSG_VALUES_4={"Ya","Tidak"};
	private CharSequence[] MSG_VALUES_5={"Ya","Tidak"};
	private CharSequence[] MSG_VALUES_6={"< 2 Jam","2 - 4 Jam","4 - 8 Jam","8 - 12 Jam","12 - 24 Jam"};
	private CharSequence[] MSG_VALUES_7={"Selalu","Hampir selalu","Kadang-kadang","Hampir tidak pernah","Tidak Pernah"};
	private CharSequence[] MSG_VALUES_8={"Pegawai (PNS/TNI/POLRI/perangkat Desa/pegawai swasta)","Petani / nelayan / buruh","Pelajar / mahasiswa / guru","Wiraswasta (pengrajin/pedagang/peternak)","Tidak bekerja"};
	private CharSequence[] MSG_VALUES_9={"< 1 jam","1 - 2 jam","2 - 3 jam","3 - 4 jam","> 4 jam"};
	private CharSequence[] MSG_VALUES_10={"Selalu berhasil dan cepat","Jarang gagal","Kadang berhasil kadang gagal","Jarang berhasil","Tidak pernah berhasil"};
	private CharSequence[] MSG_VALUES_11={"Pengujuan berhasil dilakukan. Hasilnya adalah","Pengujian koneksi internet tidak berhasil dilakukan"};
	private CharSequence[] MSG_VALUES_12={"Selalu berhasil dan cepat","Jarang gagal","Kadang berhasil kadang gagal","Jarang berhasil","Tidak pernah berhasil"};
	private CharSequence[] MSG_VALUES_13={"Unlimited","Dibatasi (sistem kuota) _____. MB","Dibatasi (waktu) _____ jam"};
	private CharSequence[] MSG_VALUES_14={"Pembagian pendapatan dengan komposisi penyedia jasa ____% dan pengelola ____%","Memberikan uang dengan besaran tertentu tiap bulannya, sebesar Rp___"};
	private CharSequence[] MSG_VALUES_15={"Sangat Puas","Puas","Biasa saja","Tidak Puas","Sangat Tidak Puas"};
	private CharSequence[] MSG_VALUES_16={"Transfer Melalui rekening bank ","Dibayar langsung","Lainnya, tuliskan _____"};
	private CharSequence[] MSG_VALUES_17={"Sangat sulit","Sulit","Kadang sulit","Mudah","Sangat mudah"};
	private CharSequence[] MSG_VALUES_18={"Ya, ada","Belum"};
	private CharSequence[] MSG_VALUES_19={"Ya, ada","Tidak"};
	private CharSequence[] MSG_VALUES_20={"Swadaya","Subsidi penyedia jasa akses telpon"};
	private CharSequence[] MSG_VALUES_21={"Tidak ada","Ada"};
	private CharSequence[] MSG_VALUES_22={"Gangguan jaringan","Kurang fasilitas telepon","Sering pemadaman listrik","Lainnya, Sebutkan"};
	protected boolean[] selectVal22={false,false,false,false};
	protected boolean[] selectVal2={false,false,false,false,false,false,false};
	private String value="";
	protected String value1="";
	@Override
	public void onBackPressed() {
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		Desa_Form4.this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.desa_f4);
		next=(Button)findViewById(R.id.desa_f4_next);
		prev=(Button)findViewById(R.id.desa_f4_prev);
		desa_f4_qes_1=(TextView)findViewById(R.id.desa_f4_qes_1); 
		desa_f4_qes_2=(TextView)findViewById(R.id.desa_f4_qes_2); 
		desa_f4_qes_2h=(TextView)findViewById(R.id.desa_f4_qes_2h);
		desa_f4_qes_3=(TextView)findViewById(R.id.desa_f4_qes_3);
		desa_f4_qes_4=(TextView)findViewById(R.id.desa_f4_qes_4);
		desa_f4_qes_5=(TextView)findViewById(R.id.desa_f4_qes_5);
		desa_f4_qes_6=(TextView)findViewById(R.id.desa_f4_qes_6);
		desa_f4_qes_7=(TextView)findViewById(R.id.desa_f4_qes_7);
		desa_f4_qes_8=(TextView)findViewById(R.id.desa_f4_qes_8);
		desa_f4_qes_9=(TextView)findViewById(R.id.desa_f4_qes_9);
		desa_f4_qes_10=(TextView)findViewById(R.id.desa_f4_qes_10);
		desa_f4_qes_11a=(TextView)findViewById(R.id.desa_f4_qes_11a);
		desa_f4_qes_11ba=(TextView)findViewById(R.id.desa_f4_qes_11ba);
		desa_f4_qes_11bb=(TextView)findViewById(R.id.desa_f4_qes_11bb);
		desa_f4_qes_11bc=(TextView)findViewById(R.id.desa_f4_qes_11bc);
		desa_f4_qes_11bd=(TextView)findViewById(R.id.desa_f4_qes_11bd);
		desa_f4_qes_11c=(TextView)findViewById(R.id.desa_f4_qes_11c);
		desa_f4_qes_12=(TextView)findViewById(R.id.desa_f4_qes_12);
		desa_f4_qes_13a=(TextView)findViewById(R.id.desa_f4_qes_13a);
		desa_f4_qes_13b=(TextView)findViewById(R.id.desa_f4_qes_13b);
		desa_f4_qes_13c=(TextView)findViewById(R.id.desa_f4_qes_13c);
		desa_f4_qes_14a=(TextView)findViewById(R.id.desa_f4_qes_14a);
		desa_f4_qes_14b=(TextView)findViewById(R.id.desa_f4_qes_14b);
		desa_f4_qes_14c=(TextView)findViewById(R.id.desa_f4_qes_14c);
		desa_f4_qes_14d=(TextView)findViewById(R.id.desa_f4_qes_14d);
		desa_f4_qes_15=(TextView)findViewById(R.id.desa_f4_qes_15);
		desa_f4_qes_16a=(TextView)findViewById(R.id.desa_f4_qes_16a);
		desa_f4_qes_16b=(TextView)findViewById(R.id.desa_f4_qes_16b);
		desa_f4_qes_17=(TextView)findViewById(R.id.desa_f4_qes_17);
		desa_f4_qes_18=(TextView)findViewById(R.id.desa_f4_qes_18);
		desa_f4_qes_19=(TextView)findViewById(R.id.desa_f4_qes_19);
		desa_f4_qes_20=(TextView)findViewById(R.id.desa_f4_qes_20);
		desa_f4_qes_21a=(TextView)findViewById(R.id.desa_f4_qes_21a);
		desa_f4_qes_21b=(TextView)findViewById(R.id.desa_f4_qes_21b);
		desa_f4_qes_22=(TextView)findViewById(R.id.desa_f4_qes_22); 
		desa_f4_qes_22e=(TextView)findViewById(R.id.desa_f4_qes_22e);
		
		desa_f4_ans_1=(EditText)findViewById(R.id.desa_f4_ans_1);   
		desa_f4_ans_2a=(CheckBox)findViewById(R.id.desa_f4_ans_2a);
		desa_f4_ans_2b=(CheckBox)findViewById(R.id.desa_f4_ans_2b);
		desa_f4_ans_2c=(CheckBox)findViewById(R.id.desa_f4_ans_2c);
		desa_f4_ans_2d=(CheckBox)findViewById(R.id.desa_f4_ans_2d);
		desa_f4_ans_2e=(CheckBox)findViewById(R.id.desa_f4_ans_2e);
		desa_f4_ans_2f=(CheckBox)findViewById(R.id.desa_f4_ans_2f);
		desa_f4_ans_2g=(CheckBox)findViewById(R.id.desa_f4_ans_2g);
		desa_f4_ans_2h=(EditText)findViewById(R.id.desa_f4_ans_2h);
		desa_f4_ans_3=(EditText)findViewById(R.id.desa_f4_ans_3);
		desa_f4_ans_4=(EditText)findViewById(R.id.desa_f4_ans_4);
		desa_f4_ans_5=(EditText)findViewById(R.id.desa_f4_ans_5);
		desa_f4_ans_6=(EditText)findViewById(R.id.desa_f4_ans_6);
		desa_f4_ans_7=(EditText)findViewById(R.id.desa_f4_ans_7);
		desa_f4_ans_8=(EditText)findViewById(R.id.desa_f4_ans_8);
		desa_f4_ans_9=(EditText)findViewById(R.id.desa_f4_ans_9);
		desa_f4_ans_10=(EditText)findViewById(R.id.desa_f4_ans_10);
		desa_f4_ans_11a=(EditText)findViewById(R.id.desa_f4_ans_11a);
		desa_f4_ans_11ba=(EditText)findViewById(R.id.desa_f4_ans_11ba);
		desa_f4_ans_11bb=(EditText)findViewById(R.id.desa_f4_ans_11bb);
		desa_f4_ans_11bc=(EditText)findViewById(R.id.desa_f4_ans_11bc);
		desa_f4_ans_11bd=(EditText)findViewById(R.id.desa_f4_ans_11bd);
		desa_f4_ans_11c=(EditText)findViewById(R.id.desa_f4_ans_11c);
		desa_f4_ans_12=(EditText)findViewById(R.id.desa_f4_ans_12);
		desa_f4_ans_13a=(EditText)findViewById(R.id.desa_f4_ans_13a);
		desa_f4_ans_13b=(EditText)findViewById(R.id.desa_f4_ans_13b);
		desa_f4_ans_13c=(EditText)findViewById(R.id.desa_f4_ans_13c);
		desa_f4_ans_14a=(EditText)findViewById(R.id.desa_f4_ans_14a);
		desa_f4_ans_14b=(EditText)findViewById(R.id.desa_f4_ans_14b);
		desa_f4_ans_14c=(EditText)findViewById(R.id.desa_f4_ans_14c);
		desa_f4_ans_14d=(EditText)findViewById(R.id.desa_f4_ans_14d);
		desa_f4_ans_15=(EditText)findViewById(R.id.desa_f4_ans_15);
		desa_f4_ans_16a=(EditText)findViewById(R.id.desa_f4_ans_16a);
		desa_f4_ans_16b=(EditText)findViewById(R.id.desa_f4_ans_16b);
		desa_f4_ans_17=(EditText)findViewById(R.id.desa_f4_ans_17);
		desa_f4_ans_18=(EditText)findViewById(R.id.desa_f4_ans_18);
		desa_f4_ans_19=(EditText)findViewById(R.id.desa_f4_ans_19);
		desa_f4_ans_20=(EditText)findViewById(R.id.desa_f4_ans_20);
		desa_f4_ans_21a=(EditText)findViewById(R.id.desa_f4_ans_21a);
		desa_f4_ans_21b=(EditText)findViewById(R.id.desa_f4_ans_21b); 
		desa_f4_ans_22a=(CheckBox)findViewById(R.id.desa_f4_ans_22a);
		desa_f4_ans_22b=(CheckBox)findViewById(R.id.desa_f4_ans_22b);
		desa_f4_ans_22c=(CheckBox)findViewById(R.id.desa_f4_ans_22c);
		desa_f4_ans_22d=(CheckBox)findViewById(R.id.desa_f4_ans_22d);
		desa_f4_ans_22e=(EditText)findViewById(R.id.desa_f4_ans_22e);

		desa_f4_ans_1.setOnClickListener(this); 
		desa_f4_ans_2a.setOnClickListener(this);
		desa_f4_ans_2b.setOnClickListener(this);
		desa_f4_ans_2c.setOnClickListener(this);
		desa_f4_ans_2d.setOnClickListener(this);
		desa_f4_ans_2e.setOnClickListener(this);
		desa_f4_ans_2f.setOnClickListener(this);
		desa_f4_ans_2g.setOnClickListener(this);  
		desa_f4_ans_2h.setOnClickListener(this); 
		desa_f4_ans_3.setOnClickListener(this);
		desa_f4_ans_4.setOnClickListener(this);
		desa_f4_ans_5.setOnClickListener(this);
		desa_f4_ans_6.setOnClickListener(this);
		desa_f4_ans_7.setOnClickListener(this);
		desa_f4_ans_8.setOnClickListener(this);
		desa_f4_ans_9.setOnClickListener(this);
		desa_f4_ans_10.setOnClickListener(this);
		desa_f4_ans_11a.setOnClickListener(this);
		desa_f4_ans_11ba.setOnClickListener(this);
		desa_f4_ans_11bb.setOnClickListener(this);
		desa_f4_ans_11bc.setOnClickListener(this);
		desa_f4_ans_11bd.setOnClickListener(this);
		desa_f4_ans_11c.setOnClickListener(this);
		desa_f4_ans_12.setOnClickListener(this);
		desa_f4_ans_13a.setOnClickListener(this);
		desa_f4_ans_13b.setOnClickListener(this);
		desa_f4_ans_13c.setOnClickListener(this); 
		desa_f4_ans_14a.setOnClickListener(this);
		desa_f4_ans_14b.setOnClickListener(this);
		desa_f4_ans_14c.setOnClickListener(this);
		desa_f4_ans_14d.setOnClickListener(this);
		desa_f4_ans_15.setOnClickListener(this);
		desa_f4_ans_16a.setOnClickListener(this);
		desa_f4_ans_16b.setOnClickListener(this);
		desa_f4_ans_17.setOnClickListener(this);
		desa_f4_ans_18.setOnClickListener(this);
		desa_f4_ans_19.setOnClickListener(this);
		desa_f4_ans_20.setOnClickListener(this);
		desa_f4_ans_21a.setOnClickListener(this);
		desa_f4_ans_21b.setOnClickListener(this);
		desa_f4_ans_22a.setOnClickListener(this);
		desa_f4_ans_22b.setOnClickListener(this);
		desa_f4_ans_22c.setOnClickListener(this);
		desa_f4_ans_22d.setOnClickListener(this);
		desa_f4_ans_22e.setOnClickListener(this);
		
		desa_f4_qes_1.setOnClickListener(this); 
		desa_f4_qes_2.setOnClickListener(this); 
		desa_f4_qes_2h.setOnClickListener(this);
		desa_f4_qes_3.setOnClickListener(this);
		desa_f4_qes_4.setOnClickListener(this);
		desa_f4_qes_5.setOnClickListener(this);
		desa_f4_qes_6.setOnClickListener(this);
		desa_f4_qes_7.setOnClickListener(this);
		desa_f4_qes_8.setOnClickListener(this);
		desa_f4_qes_9.setOnClickListener(this);
		desa_f4_qes_10.setOnClickListener(this);
		desa_f4_qes_11a.setOnClickListener(this);
		desa_f4_qes_11ba.setOnClickListener(this);
		desa_f4_qes_11bb.setOnClickListener(this);
		desa_f4_qes_11bc.setOnClickListener(this);
		desa_f4_qes_11bd.setOnClickListener(this);
		desa_f4_qes_11c.setOnClickListener(this);
		desa_f4_qes_12.setOnClickListener(this);
		desa_f4_qes_13a.setOnClickListener(this);
		desa_f4_qes_13b.setOnClickListener(this);
		desa_f4_qes_13c.setOnClickListener(this); 
		desa_f4_qes_14a.setOnClickListener(this);
		desa_f4_qes_14b.setOnClickListener(this);
		desa_f4_qes_14c.setOnClickListener(this);
		desa_f4_qes_14d.setOnClickListener(this);
		desa_f4_qes_15.setOnClickListener(this);
		desa_f4_qes_16a.setOnClickListener(this);
		desa_f4_qes_16b.setOnClickListener(this);
		desa_f4_qes_17.setOnClickListener(this);
		desa_f4_qes_18.setOnClickListener(this);
		desa_f4_qes_19.setOnClickListener(this);
		desa_f4_qes_20.setOnClickListener(this);
		desa_f4_qes_21a.setOnClickListener(this);
		desa_f4_qes_21b.setOnClickListener(this);
		desa_f4_qes_22.setOnClickListener(this);
/*
		desa_f4_qes_22a.setOnClickListener(this);
		desa_f4_qes_22b.setOnClickListener(this);
		desa_f4_qes_22c.setOnClickListener(this);
		desa_f4_qes_22d.setOnClickListener(this);
		*/ 
		desa_f4_qes_22e.setOnClickListener(this);
/*
		desa_f4_qes_1.setFocusable(false);
		desa_f4_qes_2.setFocusable(false);
		desa_f4_qes_3.setFocusable(false);
		desa_f4_qes_4.setFocusable(false);
		desa_f4_qes_5.setFocusable(false);
		desa_f4_qes_6.setFocusable(false);
		desa_f4_qes_7.setFocusable(false);
		desa_f4_qes_8.setFocusable(false);
		desa_f4_qes_9.setFocusable(false);
		desa_f4_qes_10.setFocusable(false);
		desa_f4_qes_11a.setFocusable(false);
		desa_f4_qes_11ba.setFocusable(false);
		desa_f4_qes_11bb.setFocusable(false);
		desa_f4_qes_11bc.setFocusable(false);
		desa_f4_qes_11bd.setFocusable(false);
		desa_f4_qes_11c.setFocusable(false);
		desa_f4_qes_12.setFocusable(false);
		desa_f4_qes_13a.setFocusable(false);
		desa_f4_qes_13b.setFocusable(false);
		desa_f4_qes_13c.setFocusable(false); 
		desa_f4_qes_14a.setFocusable(false);
		desa_f4_qes_14b.setFocusable(false);
		desa_f4_qes_14c.setFocusable(false);
		desa_f4_qes_14d.setFocusable(false);
		desa_f4_qes_15.setFocusable(false);
		desa_f4_qes_16a.setFocusable(false);
		desa_f4_qes_16b.setFocusable(false);
		desa_f4_qes_17.setFocusable(false);
		desa_f4_qes_18.setFocusable(false);
		desa_f4_qes_19.setFocusable(false);
		desa_f4_qes_20.setFocusable(false);
		desa_f4_qes_21a.setFocusable(false);
		desa_f4_qes_21b.setFocusable(false);
		desa_f4_qes_22.setFocusable(false);
		/*
		desa_f4_qes_22a.setFocusable(false);
		desa_f4_qes_22b.setFocusable(false);
		desa_f4_qes_22c.setFocusable(false);
		desa_f4_qes_22d.setFocusable(false);
		*/ 

		next.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent=new Intent(getApplicationContext(),Desa_Form5.class);
				startActivity(intent);
				Desa_Form4.this.finish();
				
			}
		});
		prev.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent=new Intent(getApplicationContext(),Desa_Form3.class);
				startActivity(intent);
				Desa_Form4.this.finish();
				
			}
		});
	}
	public void toast_msg()
	{
		LayoutInflater inflater = getLayoutInflater();

		View layout = inflater.inflate(R.layout.custom_toast,
				(ViewGroup) findViewById(R.id.custom_toast_layout_id));
		TextView text = (TextView) layout.findViewById(R.id.text);
		text.setText(value);
		Toast toast = new Toast(getApplicationContext());
		toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
		toast.setDuration(Toast.LENGTH_LONG);
		toast.setView(layout);
		toast.show();
	}

	@Override
	public void onClick(View v)
	{

		if(v.getId()==desa_f4_qes_1.getId())
		{
			value=getResources().getString(R.string.pinter_q4_1);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_2.getId())
		{
			value=getResources().getString(R.string.pinter_q4_2);
			toast_msg();
		} 
		else if(v.getId()==desa_f4_qes_2h.getId())
		{
			value=getResources().getString(R.string.pinter_q4_2h);
			toast_msg();
		}
		 
		else if(v.getId()==desa_f4_qes_3.getId())
		{
			value=getResources().getString(R.string.pinter_q4_3);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_4.getId())
		{
			value=getResources().getString(R.string.pinter_q4_4);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_5.getId())
		{
			value=getResources().getString(R.string.pinter_q4_5);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_6.getId())
		{
			value=getResources().getString(R.string.pinter_q4_6);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_7.getId())
		{
			value=getResources().getString(R.string.pinter_q4_7);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_8.getId())
		{
			value=getResources().getString(R.string.pinter_q4_8);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_9.getId())
		{
			value=getResources().getString(R.string.pinter_q4_9);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_10.getId())
		{
			value=getResources().getString(R.string.pinter_q4_10);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_11a.getId())
		{
			value=getResources().getString(R.string.pinter_q4_11a);
			toast_msg();
		}
		
		else if(v.getId()==desa_f4_qes_11ba.getId())
		{
			value=getResources().getString(R.string.pinter_q4_11ba);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_11bb.getId())
		{
			value=getResources().getString(R.string.pinter_q4_11bb);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_11bc.getId())
		{
			value=getResources().getString(R.string.pinter_q4_11bc);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_11bd.getId())
		{
			value=getResources().getString(R.string.pinter_q4_11bd);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_12.getId())
		{
			value=getResources().getString(R.string.pinter_q4_12);
			toast_msg();
		}
		
		
		else if(v.getId()==desa_f4_qes_13a.getId())
		{
			value=getResources().getString(R.string.pinter_q4_13a);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_13b.getId())
		{
			value=getResources().getString(R.string.pinter_q4_13b);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_13c.getId())
		{
			value=getResources().getString(R.string.pinter_q4_13c);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_14a.getId())
		{
			value=getResources().getString(R.string.pinter_q4_14a);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_14b.getId())
		{
			value=getResources().getString(R.string.pinter_q4_14b);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_14c.getId())
		{
			value=getResources().getString(R.string.pinter_q4_14c);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_14d.getId())
		{
			value=getResources().getString(R.string.pinter_q4_14d);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_15.getId())
		{
			value=getResources().getString(R.string.pinter_q4_15);
			toast_msg();
		}
		
		else if(v.getId()==desa_f4_qes_16a.getId())
		{
			value=getResources().getString(R.string.pinter_q4_16a);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_16b.getId())
		{
			value=getResources().getString(R.string.pinter_q4_16b);
			toast_msg();
		}
		
		else if(v.getId()==desa_f4_qes_17.getId())
		{
			value=getResources().getString(R.string.pinter_q4_17);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_18.getId())
		{
			value=getResources().getString(R.string.pinter_q4_18);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_19.getId())
		{
			value=getResources().getString(R.string.pinter_q4_19);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_20.getId())
		{
			value=getResources().getString(R.string.pinter_q4_20);
			toast_msg();
		}
		else if(v.getId()==desa_f4_qes_21a.getId())
		{
			value=getResources().getString(R.string.pinter_q4_21a);
			toast_msg();
		} 
		else if(v.getId()==desa_f4_qes_21b.getId())
		{
			value=getResources().getString(R.string.pinter_q4_21b);
			toast_msg();
		} 
		else if(v.getId()==desa_f4_qes_22.getId())
		{
			value=getResources().getString(R.string.pinter_q4_22);
			toast_msg();
		} 
		else if(v.getId()==desa_f4_qes_22e.getId())
		{
			value=getResources().getString(R.string.pinter_q4_22b);
			toast_msg();
		}
		
		
		else if(v.getId()==desa_f4_ans_1.getId())
		{
			msg_f4_ans_1();
		}
		else if(v.getId()==desa_f4_ans_2a.getId())
		{
			desa_f4_ans_2a.setChecked(false);
			msg_f4_ans_2();
		}
		else if(v.getId()==desa_f4_ans_2b.getId())
		{
			desa_f4_ans_2b.setChecked(false);
			msg_f4_ans_2();
		}
		else if(v.getId()==desa_f4_ans_2c.getId())
		{
			desa_f4_ans_2c.setChecked(false);
			msg_f4_ans_2();
		}
		else if(v.getId()==desa_f4_ans_2d.getId())
		{
			desa_f4_ans_2d.setChecked(false);
			msg_f4_ans_2(); 
		}
		else if(v.getId()==desa_f4_ans_2e.getId())
		{
			desa_f4_ans_2e.setChecked(false);
			msg_f4_ans_2(); 
		}
		else if(v.getId()==desa_f4_ans_2f.getId())
		{
			desa_f4_ans_2f.setChecked(false);
			msg_f4_ans_2(); 
		}
		else if(v.getId()==desa_f4_ans_2g.getId())
		{
			desa_f4_ans_2g.setChecked(false);
			msg_f4_ans_2(); 
		}
		else if(v.getId()==desa_f4_ans_4.getId())
		{
			msg_f4_ans_4();
		}
		else if(v.getId()==desa_f4_ans_5.getId())
		{
			msg_f4_ans_5();
		}
		else if(v.getId()==desa_f4_ans_6.getId())
		{
			msg_f4_ans_6();
		}
		else if(v.getId()==desa_f4_ans_7.getId())
		{
			msg_f4_ans_7();
		}
		else if(v.getId()==desa_f4_ans_8.getId())
		{
			msg_f4_ans_8();
		}
		else if(v.getId()==desa_f4_ans_9.getId())
		{
			msg_f4_ans_9();
		}
		else if(v.getId()==desa_f4_ans_10.getId())
		{
			msg_f4_ans_10();
		}
		else if(v.getId()==desa_f4_ans_11a.getId())
		{
			msg_f4_ans_11();
		}
		
		else if(v.getId()==desa_f4_ans_12.getId())
		{
			msg_f4_ans_12();
		}
		else if(v.getId()==desa_f4_ans_13a.getId())
		{
			msg_f4_ans_13();
		}
		 
		else if(v.getId()==desa_f4_ans_14a.getId())
		{
			msg_f4_ans_14();
		}
		else if(v.getId()==desa_f4_ans_15.getId())
		{
			msg_f4_ans_15();
		}
		
		else if(v.getId()==desa_f4_ans_16a.getId())
		{
			msg_f4_ans_16();
		}
		
		else if(v.getId()==desa_f4_ans_17.getId())
		{
			msg_f4_ans_17();
		}
		else if(v.getId()==desa_f4_ans_18.getId())
		{
			msg_f4_ans_18();
		}
		
		else if(v.getId()==desa_f4_ans_19.getId())
		{
			msg_f4_ans_19();
		}
		else if(v.getId()==desa_f4_ans_20.getId())
		{
			msg_f4_ans_20();
		}
		else if(v.getId()==desa_f4_ans_21a.getId())
		{
			msg_f4_ans_21();
		} 
		
		else if(v.getId()==desa_f4_ans_22a.getId())
		{
			desa_f4_ans_22a.setChecked(false);
			msg_f4_ans_22();
		}
		else if(v.getId()==desa_f4_ans_22b.getId())
		{
			desa_f4_ans_22b.setChecked(false);
			msg_f4_ans_22();
		}
		else if(v.getId()==desa_f4_ans_22c.getId())
		{
			desa_f4_ans_22c.setChecked(false);
			msg_f4_ans_22();
		}
		else if(v.getId()==desa_f4_ans_22d.getId())
		{
			desa_f4_ans_22d.setChecked(false);
			msg_f4_ans_22();
		}
		
		
		
	}
	private void msg_f4_ans_1() {
	     Builder builder = new AlertDialog.Builder(this);
	     builder.setTitle("Select");
	     builder.setSingleChoiceItems(MSG_VALUES_1, -1, new DialogInterface.OnClickListener() {
	       

		@Override
	       public void onClick(DialogInterface dialog, int which) {
			 desa_f4_ans_1.setText(""+(which+1));
	         dialog.dismiss();
	         
	       }
	     });
	     builder.setNegativeButton("cancel",
	         new DialogInterface.OnClickListener() {
	           @Override
	           public void onClick(DialogInterface dialog, int which) {
	             dialog.dismiss();
	           }
	         });
	     AlertDialog alert = builder.create();
	     alert.show();
	   }
	 
	 private void msg_f4_ans_2()
	   {
		     Builder builder = new AlertDialog.Builder(this);
		     builder.setTitle("Answer");
		     builder.setMultiChoiceItems(MSG_VALUES_2, selectVal2,
		         new DialogInterface.OnMultiChoiceClickListener()
		     {
		           @Override
		           public void onClick(DialogInterface dialog, int which,
		               boolean isChecked) 
		           {
		             selectVal2[which] = isChecked;
		           }
		         });
		     builder.setPositiveButton("Set", new DialogInterface.OnClickListener() {
		       @Override
		       public void onClick(DialogInterface dialog, int which) {
		         for (int i = 0; i <MSG_VALUES_2.length; i++) 
		         {
		           if (selectVal2[i]) 
		           {
		              if(i==0)
		 				{
		            	 
		 					desa_f4_ans_2a.setChecked(true);
	 					}
		 				else if(i==1)
		 				{
		 					desa_f4_ans_2b.setChecked(true);
		 				}
		 				else if(i==2)
		 				{
		 					desa_f4_ans_2c.setChecked(true);
		 				}
		 				else if(i==3)
		 				{
		 					desa_f4_ans_2d.setChecked(true);
		 				}
		 				else if(i==4)
		 				{
		 					desa_f4_ans_2e.setChecked(true);
		 				}
		 				else if(i==5)
		 				{
		 					desa_f4_ans_2f.setChecked(true);
		 				}
		 				else if(i==6)
		 				{
		 					desa_f4_ans_2g.setChecked(true);
		 				} 
		           }
		           else
		           {
		        	   if(i==0)
		 				{
		            	 
		 					desa_f4_ans_2a.setChecked(false);
	 					}
		 				else if(i==1)
		 				{
		 					desa_f4_ans_2b.setChecked(false);
		 				}
		 				else if(i==2)
		 				{
		 					desa_f4_ans_2c.setChecked(false);
		 				}
		 				else if(i==3)
		 				{
		 					desa_f4_ans_2d.setChecked(false);
		 				}
		 				else if(i==4)
		 				{
		 					desa_f4_ans_2e.setChecked(false);
		 				}
		 				else if(i==5)
		 				{
		 					desa_f4_ans_2f.setChecked(false);
		 				}
		 				else if(i==6)
		 				{
		 					desa_f4_ans_2g.setChecked(false);
		 				}
		 				
		           }
		         }
		        }
		     });
		     builder.setNegativeButton("cancel",
		         new DialogInterface.OnClickListener() {
		           @Override
		           public void onClick(DialogInterface dialog, int which) {
		             dialog.dismiss();
		           }
		         });
		     AlertDialog alert = builder.create();
		     alert.show();
		   }
	
	private void msg_f4_ans_4() {
	     Builder builder = new AlertDialog.Builder(this);
	     builder.setTitle("Select");
	     builder.setSingleChoiceItems(MSG_VALUES_4, -1, new DialogInterface.OnClickListener() {
	       

		@Override
	       public void onClick(DialogInterface dialog, int which) {
			 desa_f4_ans_4.setText(""+(which+1));
	         dialog.dismiss();
	         
	       }
	     });
	     builder.setNegativeButton("cancel",
	         new DialogInterface.OnClickListener() {
	           @Override
	           public void onClick(DialogInterface dialog, int which) {
	             dialog.dismiss();
	           }
	         });
	     AlertDialog alert = builder.create();
	     alert.show();
	   }
	private void msg_f4_ans_5() {
	     Builder builder = new AlertDialog.Builder(this);
	     builder.setTitle("Select");
	     builder.setSingleChoiceItems(MSG_VALUES_5, -1, new DialogInterface.OnClickListener() {
	       

		@Override
	       public void onClick(DialogInterface dialog, int which) {
			 desa_f4_ans_5.setText(""+(which+1));
	         dialog.dismiss();
	         
	       }
	     });
	     builder.setNegativeButton("cancel",
	         new DialogInterface.OnClickListener() {
	           @Override
	           public void onClick(DialogInterface dialog, int which) {
	             dialog.dismiss();
	           }
	         });
	     AlertDialog alert = builder.create();
	     alert.show();
	   }
	
	private void msg_f4_ans_6() {
	     Builder builder = new AlertDialog.Builder(this);
	     builder.setTitle("Select");
	     builder.setSingleChoiceItems(MSG_VALUES_6, -1, new DialogInterface.OnClickListener() {
	       

		@Override
	       public void onClick(DialogInterface dialog, int which) {
			 desa_f4_ans_6.setText(""+(which+1));
	         dialog.dismiss();
	         
	       }
	     });
	     builder.setNegativeButton("cancel",
	         new DialogInterface.OnClickListener() {
	           @Override
	           public void onClick(DialogInterface dialog, int which) {
	             dialog.dismiss();
	           }
	         });
	     AlertDialog alert = builder.create();
	     alert.show();
	   }
	private void msg_f4_ans_7() {
	     Builder builder = new AlertDialog.Builder(this);
	     builder.setTitle("Select");
	     builder.setSingleChoiceItems(MSG_VALUES_7, -1, new DialogInterface.OnClickListener() {
	       

		@Override
	       public void onClick(DialogInterface dialog, int which) {
			 desa_f4_ans_7.setText(""+(which+1));
	         dialog.dismiss();
	         
	       }
	     });
	     builder.setNegativeButton("cancel",
	         new DialogInterface.OnClickListener() {
	           @Override
	           public void onClick(DialogInterface dialog, int which) {
	             dialog.dismiss();
	           }
	         });
	     AlertDialog alert = builder.create();
	     alert.show();
	   }
	private void msg_f4_ans_8() {
	     Builder builder = new AlertDialog.Builder(this);
	     builder.setTitle("Select");
	     builder.setSingleChoiceItems(MSG_VALUES_8, -1, new DialogInterface.OnClickListener() {
	       

		@Override
	       public void onClick(DialogInterface dialog, int which) {
			 desa_f4_ans_8.setText(""+(which+1));
	         dialog.dismiss();
	         
	       }
	     });
	     builder.setNegativeButton("cancel",
	         new DialogInterface.OnClickListener() {
	           @Override
	           public void onClick(DialogInterface dialog, int which) {
	             dialog.dismiss();
	           }
	         });
	     AlertDialog alert = builder.create();
	     alert.show();
	   }
	private void msg_f4_ans_9() {
	     Builder builder = new AlertDialog.Builder(this);
	     builder.setTitle("Select");
	     builder.setSingleChoiceItems(MSG_VALUES_9, -1, new DialogInterface.OnClickListener() {
	       

		@Override
	       public void onClick(DialogInterface dialog, int which) {
			 desa_f4_ans_9.setText(""+(which+1));
	         dialog.dismiss();
	         
	       }
	     });
	     builder.setNegativeButton("cancel",
	         new DialogInterface.OnClickListener() {
	           @Override
	           public void onClick(DialogInterface dialog, int which) {
	             dialog.dismiss();
	           }
	         });
	     AlertDialog alert = builder.create();
	     alert.show();
	   }
	private void msg_f4_ans_10() {
	     Builder builder = new AlertDialog.Builder(this);
	     builder.setTitle("Select");
	     builder.setSingleChoiceItems(MSG_VALUES_10, -1, new DialogInterface.OnClickListener() {
	       

		@Override
	       public void onClick(DialogInterface dialog, int which) {
			 desa_f4_ans_10.setText(""+(which+1));
	         dialog.dismiss();
	         
	       }
	     });
	     builder.setNegativeButton("cancel",
	         new DialogInterface.OnClickListener() {
	           @Override
	           public void onClick(DialogInterface dialog, int which) {
	             dialog.dismiss();
	           }
	         });
	     AlertDialog alert = builder.create();
	     alert.show();
	   }
	private void msg_f4_ans_11() {
	     Builder builder = new AlertDialog.Builder(this);
	     builder.setTitle("Select");
	     builder.setSingleChoiceItems(MSG_VALUES_11, -1, new DialogInterface.OnClickListener() {
	       

		@Override
	       public void onClick(DialogInterface dialog, int which) {
			 desa_f4_ans_11a.setText(""+(which+1));
	         dialog.dismiss();
	         
	       }
	     });
	     builder.setNegativeButton("cancel",
	         new DialogInterface.OnClickListener() {
	           @Override
	           public void onClick(DialogInterface dialog, int which) {
	             dialog.dismiss();
	           }
	         });
	     AlertDialog alert = builder.create();
	     alert.show();
	   }
	private void msg_f4_ans_12() {
	     Builder builder = new AlertDialog.Builder(this);
	     builder.setTitle("Select");
	     builder.setSingleChoiceItems(MSG_VALUES_12, -1, new DialogInterface.OnClickListener() {
	       

		@Override
	       public void onClick(DialogInterface dialog, int which) {
			 desa_f4_ans_12.setText(""+(which+1));
	         dialog.dismiss();
	         
	       }
	     });
	     builder.setNegativeButton("cancel",
	         new DialogInterface.OnClickListener() {
	           @Override
	           public void onClick(DialogInterface dialog, int which) {
	             dialog.dismiss();
	           }
	         });
	     AlertDialog alert = builder.create();
	     alert.show();
	   }
	private void msg_f4_ans_13() {
	     Builder builder = new AlertDialog.Builder(this);
	     builder.setTitle("Select");
	     builder.setSingleChoiceItems(MSG_VALUES_13, -1, new DialogInterface.OnClickListener() {
	       

		@Override
	       public void onClick(DialogInterface dialog, int which) {
			 desa_f4_ans_13a.setText(""+(which+1));
	         dialog.dismiss();
	         
	       }
	     });
	     builder.setNegativeButton("cancel",
	         new DialogInterface.OnClickListener() {
	           @Override
	           public void onClick(DialogInterface dialog, int which) {
	             dialog.dismiss();
	           }
	         });
	     AlertDialog alert = builder.create();
	     alert.show();
	   }
	private void msg_f4_ans_14() {
	     Builder builder = new AlertDialog.Builder(this);
	     builder.setTitle("Select");
	     builder.setSingleChoiceItems(MSG_VALUES_14, -1, new DialogInterface.OnClickListener() {
	       

		@Override
	       public void onClick(DialogInterface dialog, int which) {
			 desa_f4_ans_14a.setText(""+(which+1));
	         dialog.dismiss();
	         
	       }
	     });
	     builder.setNegativeButton("cancel",
	         new DialogInterface.OnClickListener() {
	           @Override
	           public void onClick(DialogInterface dialog, int which) {
	             dialog.dismiss();
	           }
	         });
	     AlertDialog alert = builder.create();
	     alert.show();
	   }
	private void msg_f4_ans_15() {
	     Builder builder = new AlertDialog.Builder(this);
	     builder.setTitle("Select");
	     builder.setSingleChoiceItems(MSG_VALUES_15, -1, new DialogInterface.OnClickListener() {
	       

		@Override
	       public void onClick(DialogInterface dialog, int which) {
			 desa_f4_ans_15.setText(""+(which+1));
	         dialog.dismiss();
	         
	       }
	     });
	     builder.setNegativeButton("cancel",
	         new DialogInterface.OnClickListener() {
	           @Override
	           public void onClick(DialogInterface dialog, int which) {
	             dialog.dismiss();
	           }
	         });
	     AlertDialog alert = builder.create();
	     alert.show();
	   }
	private void msg_f4_ans_16() {
	     Builder builder = new AlertDialog.Builder(this);
	     builder.setTitle("Select");
	     builder.setSingleChoiceItems(MSG_VALUES_16, -1, new DialogInterface.OnClickListener() {
	       

		@Override
	       public void onClick(DialogInterface dialog, int which) {
			 desa_f4_ans_16a.setText(""+(which+1));
	         dialog.dismiss();
	         
	       }
	     });
	     builder.setNegativeButton("cancel",
	         new DialogInterface.OnClickListener() {
	           @Override
	           public void onClick(DialogInterface dialog, int which) {
	             dialog.dismiss();
	           }
	         });
	     AlertDialog alert = builder.create();
	     alert.show();
	   }
	private void msg_f4_ans_17() {
	     Builder builder = new AlertDialog.Builder(this);
	     builder.setTitle("Select");
	     builder.setSingleChoiceItems(MSG_VALUES_17, -1, new DialogInterface.OnClickListener() {
	       

		@Override
	       public void onClick(DialogInterface dialog, int which) {
			 desa_f4_ans_17.setText(""+(which+1));
	         dialog.dismiss();
	         
	       }
	     });
	     builder.setNegativeButton("cancel",
	         new DialogInterface.OnClickListener() {
	           @Override
	           public void onClick(DialogInterface dialog, int which) {
	             dialog.dismiss();
	           }
	         });
	     AlertDialog alert = builder.create();
	     alert.show();
	   }
	private void msg_f4_ans_18() {
	     Builder builder = new AlertDialog.Builder(this);
	     builder.setTitle("Select");
	     builder.setSingleChoiceItems(MSG_VALUES_18, -1, new DialogInterface.OnClickListener() {
	       

		@Override
	       public void onClick(DialogInterface dialog, int which) {
			 desa_f4_ans_18.setText(""+(which+1));
	         dialog.dismiss();
	         
	       }
	     });
	     builder.setNegativeButton("cancel",
	         new DialogInterface.OnClickListener() {
	           @Override
	           public void onClick(DialogInterface dialog, int which) {
	             dialog.dismiss();
	           }
	         });
	     AlertDialog alert = builder.create();
	     alert.show();
	   }
	private void msg_f4_ans_19() {
	     Builder builder = new AlertDialog.Builder(this);
	     builder.setTitle("Select");
	     builder.setSingleChoiceItems(MSG_VALUES_19, -1, new DialogInterface.OnClickListener() {
	       

		@Override
	       public void onClick(DialogInterface dialog, int which) {
			 desa_f4_ans_19.setText(""+(which+1));
	         dialog.dismiss();
	         
	       }
	     });
	     builder.setNegativeButton("cancel",
	         new DialogInterface.OnClickListener() {
	           @Override
	           public void onClick(DialogInterface dialog, int which) {
	             dialog.dismiss();
	           }
	         });
	     AlertDialog alert = builder.create();
	     alert.show();
	   }
	private void msg_f4_ans_20() {
	     Builder builder = new AlertDialog.Builder(this);
	     builder.setTitle("Select");
	     builder.setSingleChoiceItems(MSG_VALUES_20, -1, new DialogInterface.OnClickListener() {
	       

		@Override
	       public void onClick(DialogInterface dialog, int which) {
			 desa_f4_ans_20.setText(""+(which+1));
	         dialog.dismiss();
	         
	       }
	     });
	     builder.setNegativeButton("cancel",
	         new DialogInterface.OnClickListener() {
	           @Override
	           public void onClick(DialogInterface dialog, int which) {
	             dialog.dismiss();
	           }
	         });
	     AlertDialog alert = builder.create();
	     alert.show();
	   }
	private void msg_f4_ans_21() {
	     Builder builder = new AlertDialog.Builder(this);
	     builder.setTitle("Select");
	     builder.setSingleChoiceItems(MSG_VALUES_21, -1, new DialogInterface.OnClickListener() {
	       

		@Override
	       public void onClick(DialogInterface dialog, int which) {
			 desa_f4_ans_21a.setText(""+(which+1));
	         dialog.dismiss();
	         
	       }
	     });
	     builder.setNegativeButton("cancel",
	         new DialogInterface.OnClickListener() {
	           @Override
	           public void onClick(DialogInterface dialog, int which) {
	             dialog.dismiss();
	           }
	         });
	     AlertDialog alert = builder.create();
	     alert.show();
	   }
	
	 private void msg_f4_ans_22()
	   {
		     Builder builder = new AlertDialog.Builder(this);
		     builder.setTitle("Answer");
		     builder.setMultiChoiceItems(MSG_VALUES_22, selectVal22,
		         new DialogInterface.OnMultiChoiceClickListener()
		     {
		           @Override
		           public void onClick(DialogInterface dialog, int which,
		               boolean isChecked) 
		           {
		             selectVal22[which] = isChecked;
		           }
		         });
		     builder.setPositiveButton("Set", new DialogInterface.OnClickListener() {
		       @Override
		       public void onClick(DialogInterface dialog, int which) {
		         for (int i = 0; i <MSG_VALUES_22.length; i++) 
		         {
		           if (selectVal22[i]) 
		           {
		              if(i==0)
		 				{
		            	 
		 					desa_f4_ans_22a.setChecked(true);
	 					}
		 				else if(i==1)
		 				{
		 					desa_f4_ans_22b.setChecked(true);
		 				}
		 				else if(i==2)
		 				{
		 					desa_f4_ans_22c.setChecked(true);
		 				}
		 				else if(i==3)
		 				{
		 					desa_f4_ans_22d.setChecked(true);
		 				}
		           }
		           else
		           {
		        	   if(i==0)
		 				{
		            	 
		 					desa_f4_ans_22a.setChecked(false);
	 					}
		 				else if(i==1)
		 				{
		 					desa_f4_ans_22b.setChecked(false);
		 				}
		 				else if(i==2)
		 				{
		 					desa_f4_ans_22c.setChecked(false);
		 				}
		 				else if(i==3)
		 				{
		 					desa_f4_ans_22d.setChecked(false);
		 				}
		 				
		           }
		         }
		        }
		     });
		     builder.setNegativeButton("cancel",
		         new DialogInterface.OnClickListener() {
		           @Override
		           public void onClick(DialogInterface dialog, int which) {
		             dialog.dismiss();
		           }
		         });
		     AlertDialog alert = builder.create();
		     alert.show();
		   }
	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
		SharedPreferences preferences=getSharedPreferences("desa_f4_details", MODE_PRIVATE);
		SharedPreferences.Editor editor=preferences.edit();
		editor.putString("4_1",desa_f4_ans_1.getText().toString().trim());
		editor.putBoolean("4_2a",desa_f4_ans_2a.isChecked());
		editor.putBoolean("4_2b",desa_f4_ans_2b.isChecked());
		editor.putBoolean("4_2c",desa_f4_ans_2c.isChecked());
		editor.putBoolean("4_2d",desa_f4_ans_2d.isChecked());
		editor.putBoolean("4_2e",desa_f4_ans_2e.isChecked());
		editor.putBoolean("4_2f",desa_f4_ans_2f.isChecked());
		editor.putBoolean("4_2g",desa_f4_ans_2g.isChecked());
		editor.putString("4_2h",desa_f4_ans_2h.getText().toString().trim());
		editor.putString("4_3",desa_f4_ans_3.getText().toString().trim());
		editor.putString("4_4",desa_f4_ans_4.getText().toString().trim());
		editor.putString("4_5",desa_f4_ans_5.getText().toString().trim());
		editor.putString("4_6",desa_f4_ans_6.getText().toString().trim());
		editor.putString("4_7",desa_f4_ans_7.getText().toString().trim());
		editor.putString("4_8",desa_f4_ans_8.getText().toString().trim());
		editor.putString("4_9",desa_f4_ans_9.getText().toString().trim());  
		editor.putString("4_10",desa_f4_ans_10.getText().toString().trim());
		editor.putString("4_11a",desa_f4_ans_11a.getText().toString().trim());
		editor.putString("4_11ba",desa_f4_ans_11ba.getText().toString().trim());
		editor.putString("4_11bb",desa_f4_ans_11bb.getText().toString().trim());
		editor.putString("4_11bc",desa_f4_ans_11bc.getText().toString().trim());
		editor.putString("4_11bd",desa_f4_ans_11bd.getText().toString().trim());
		editor.putString("4_11c",desa_f4_ans_11c.getText().toString().trim());
		editor.putString("4_12",desa_f4_ans_12.getText().toString().trim());
		editor.putString("4_13a",desa_f4_ans_13a.getText().toString().trim());
		editor.putString("4_13b",desa_f4_ans_13b.getText().toString().trim());
		editor.putString("4_13c",desa_f4_ans_13c.getText().toString().trim());
		editor.putString("4_14a",desa_f4_ans_14a.getText().toString().trim());
		editor.putString("4_14b",desa_f4_ans_14b.getText().toString().trim());
		editor.putString("4_14c",desa_f4_ans_14c.getText().toString().trim());
		editor.putString("4_14d",desa_f4_ans_14d.getText().toString().trim());
		editor.putString("4_15",desa_f4_ans_15.getText().toString().trim());
		editor.putString("4_16a",desa_f4_ans_16a.getText().toString().trim());
		editor.putString("4_16b",desa_f4_ans_16b.getText().toString().trim());
		editor.putString("4_17",desa_f4_ans_17.getText().toString().trim());
		editor.putString("4_18",desa_f4_ans_18.getText().toString().trim());
		editor.putString("4_19",desa_f4_ans_19.getText().toString().trim());
		editor.putString("4_20",desa_f4_ans_20.getText().toString().trim());
		editor.putString("4_21a",desa_f4_ans_21a.getText().toString().trim());
		editor.putString("4_21b",desa_f4_ans_21b.getText().toString().trim());
		editor.putBoolean("4_22a",desa_f4_ans_22a.isChecked());
		editor.putBoolean("4_22b",desa_f4_ans_22b.isChecked());
		editor.putBoolean("4_22c",desa_f4_ans_22c.isChecked());
		editor.putBoolean("4_22d",desa_f4_ans_22d.isChecked());
		editor.commit();
	}
	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		SharedPreferences preferences=getSharedPreferences("desa_f4_details",MODE_PRIVATE);
		desa_f4_ans_1.setText(preferences.getString("4_1",""));
		desa_f4_ans_2a.setChecked(preferences.getBoolean("4_2a",false));
		desa_f4_ans_2b.setChecked(preferences.getBoolean("4_2b",false));
		desa_f4_ans_2c.setChecked(preferences.getBoolean("4_2c",false));
		desa_f4_ans_2d.setChecked(preferences.getBoolean("4_2d",false));
		desa_f4_ans_2e.setChecked(preferences.getBoolean("4_2e",false));
		desa_f4_ans_2f.setChecked(preferences.getBoolean("4_2f",false));
		desa_f4_ans_2g.setChecked(preferences.getBoolean("4_2g",false)); 
		desa_f4_ans_2h.setText(preferences.getString("4_2h",""));
		desa_f4_ans_3.setText(preferences.getString("4_3",""));
		desa_f4_ans_4.setText(preferences.getString("4_4",""));
		desa_f4_ans_5.setText(preferences.getString("4_5",""));
		desa_f4_ans_6.setText(preferences.getString("4_6",""));
		desa_f4_ans_7.setText(preferences.getString("4_7",""));
		desa_f4_ans_8.setText(preferences.getString("4_8",""));
		desa_f4_ans_9.setText(preferences.getString("4_9","")); 
		desa_f4_ans_10.setText(preferences.getString("4_10",""));
		desa_f4_ans_11a.setText(preferences.getString("4_11a",""));
		desa_f4_ans_11ba.setText(preferences.getString("4_11ba",""));
		desa_f4_ans_11bb.setText(preferences.getString("4_11bb",""));
		desa_f4_ans_11bc.setText(preferences.getString("4_11bc",""));
		desa_f4_ans_11bd.setText(preferences.getString("4_11bd",""));
		desa_f4_ans_11c.setText(preferences.getString("4_11c",""));
		desa_f4_ans_12.setText(preferences.getString("4_12",""));
		desa_f4_ans_13a.setText(preferences.getString("4_13a",""));
		desa_f4_ans_13b.setText(preferences.getString("4_13b",""));
		desa_f4_ans_13c.setText(preferences.getString("4_13c",""));
		desa_f4_ans_14a.setText(preferences.getString("4_14a",""));
		desa_f4_ans_14b.setText(preferences.getString("4_14b",""));
		desa_f4_ans_14c.setText(preferences.getString("4_14c",""));
		desa_f4_ans_14d.setText(preferences.getString("4_14d",""));
		desa_f4_ans_15.setText(preferences.getString("4_15",""));
		desa_f4_ans_16a.setText(preferences.getString("4_16a",""));
		desa_f4_ans_16b.setText(preferences.getString("4_16b",""));
		desa_f4_ans_17.setText(preferences.getString("4_17",""));
		desa_f4_ans_18.setText(preferences.getString("4_18",""));
		desa_f4_ans_19.setText(preferences.getString("4_19",""));
		desa_f4_ans_20.setText(preferences.getString("4_20",""));
		desa_f4_ans_21a.setText(preferences.getString("4_21a",""));
		desa_f4_ans_21b.setText(preferences.getString("4_21b",""));
		desa_f4_ans_22a.setChecked(preferences.getBoolean("4_22a",false));
		desa_f4_ans_22b.setChecked(preferences.getBoolean("4_22b",false));
		desa_f4_ans_22c.setChecked(preferences.getBoolean("4_22c",false));
		desa_f4_ans_22d.setChecked(preferences.getBoolean("4_22d",false));
		desa_f4_ans_22e.setText(preferences.getString("4_22e",""));
	}
	

}
